<?php
require_once realpath (dirname (__FILE__) . '//..//..//..//..//pages.php');
require_once INC_FUNCTIONS;
$db = openConnection();
$result = $db->select (array ('studente', 'frequenta', 'indirizzo'), array ('indirizzo.nome AS indirizzo', 'COUNT(*) AS studenti'), 'frequenta.IDstudente = studente.ID AND frequenta.IDindirizzo = indirizzo.ID', 'indirizzo.ID', 'indirizzo.nome');
while ($row = $db->fetchAssoc ($result)) {
    $x[] = $row['indirizzo'];
    $y[] = $row['studenti'];
}

require_once GRAPH_PIE;
?>